open(BUFF,"trans_eqtl_10PowMinus11_soreted_snpChrPos.txt");
open(WRBUFF,">out_trans_eqtl_10PowMinus11_soreted_snpChrPos.txt");
$line = <BUFF>;
print WRBUFF $line;
$i=1;
$temp = <BUFF>;
chomp($temp);
$count =1;
while(<BUFF>)
{
	$i++;
	chomp($_);
	@array = split("\t",$_);
	if($array[3] < 1e-11)
	{
		@temp = split("\t",$temp);
		if($i != 2 && $temp[1] != $array[1])
		{
			$count =1;
		}
		if($temp[1] == $array[1] && $array[6] eq $temp[6] && $array[7]-$temp[7] <1000000 && $array[3] < 1e-11) 
		{
			if($count == 2)
			{
				print WRBUFF $temp."\n";
			}
			print WRBUFF $_."\n";
		}
		$temp = $_;
		$count++;
	}
}
